package com.heima.admin.service.impl;

import com.heima.admin.mapper.WmNewsAuthorMapper;
import com.heima.admin.service.IWmNewsAuthorService;
import com.heima.api.schedule.WemediaFeign;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
public class WmNewsAuthorServiceImpl implements IWmNewsAuthorService {
    private final WmNewsAuthorMapper wmNewsAuthorMapper;
    private final WemediaFeign newsClient;

    @Override
    public PageResponseResult newsAuth(NewsAuthDto newsAuthDto) {
        PageResponseResult result = newsClient.newsAuthList(newsAuthDto);
        return result;
    }

    @Override
    public ResponseResult queryNewsOne(Integer id) {
        return newsClient.queryNewsOne(id);
    }


    /**
     * 文章审核失败
     * @param newsAuthDto
     * @return
     */
    @Override
    public ResponseResult authFail(NewsAuthDto newsAuthDto) {
        return newsClient.authFail(newsAuthDto);
    }


    /**
     * 文章审核成功
     * @param newsAuthDto
     * @return
     */
    @Override
    public ResponseResult authPass(NewsAuthDto newsAuthDto) {
        return newsClient.authPass(newsAuthDto);
    }
}
